﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

using DataAccess;
namespace SQT.tracnghiem.Admin
{
    public partial class LetterManager : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void CheckPermission()
        {
            int pageID = Convert.ToInt32(Request.QueryString["pageID"]);
            var AM_AcceptColl = new TblAdminMenuController().FetchAll();
            var AM_Accept = AM_AcceptColl.Single(y => y.AmId == pageID);
            string[] acceptUser = AM_Accept.ToString().Split(',');
            string adminID = Session["admin_id"].ToString();
            foreach (string a in acceptUser)
            {
                if (a.ToString() == adminID)
                    return;
            }
            Response.Redirect("~/Default.aspx");
        }
    }
}